/*
** signal.c for signal.c in /home/vermel/local/epitech/tek2/c/ftrace/pullup-project
** 
** Made by nathan vermelle
** Login   <vermel_n@epitech.net>
** 
** Started on  Fri Jun 29 14:08:00 2012 nathan vermelle
** Last update Fri Jun 29 14:08:01 2012 nathan vermelle
*/

#include "./../includes/ftrace.h"

static unsigned int childPid = 0;

void	handler(int sig)
{
   printf("Signal : %d.\n", childPid);
   if (kill(childPid, sig) == -1)
      merror("Kill failed");
}

void	catchSignal(unsigned int pid)
{
   childPid = pid;
   signal(SIGINT, handler);
}
